MainMenuConfig = [{
    title: "Base",
    divider: !0
},
{
    title: "Dashboard",
    url: "#/?url=app/modules/dashboard&title=dashboard",
    icon: "zmdi zmdi-home"
},
{
    title: "Form",
    icon: "zmdi zmdi-border-all",
    submenu: [{
        title: "Form Examples",
        url: "#/?url=app/modules/form&title=form examples"
    },
    {
        title: "Form Components",
        url: "#/?url=app/modules/mdcomponents&title=form components"
    }]
},
{
    title: "Table",
    icon: "zmdi zmdi-format-list-bulleted",
    url: "#/?url=app/modules/table&title=table"
},
{
    title: "Card Panel",
    icon: "zmdi zmdi-collection-text",
    submenu: [{
        title: "Panel",
        url: "#/?url=app/modules/panels&title=panel"
    },
    {
        title: "Card",
        url: "#/?url=app/modules/card&title=card"
    }]
},
{
    title: "UI Elements",
    icon: "zmdi zmdi-widgets",
    submenu: [{
        title: "Buttons",
        url: "#/?url=app/modules/button&title=button"
    },
    {
        title: "Dialog",
        url: "#/?url=app/modules/dialog&title=dialog"
    },
    {
        title: "Tabs",
        url: "#/?url=app/modules/tabs&title=tabs"
    },
    {
        title: "Progress",
        url: "#/?url=app/modules/progress&title=progress"
    },
    {
        title: "Notification & Toast",
        url: "#/?url=app/modules/toast&title=notification toast"
    },
    {
        title: "Bootstrap Grid",
        url: "#/?url=app/modules/grid&title=layout grid"
    },
    {
        title: "Box & Shadow",
        url: "#/?url=app/modules/box&title=box shadow"
    },
    {
        title: "Menu",
        url: "#/?url=app/modules/menu&title=context menu"
    },
    {
        title: "Bootstrap Components",
        url: "#/?url=app/modules/bscomponents&title=bs components"
    }]
},
{
    title: "Icons",
    icon: "zmdi zmdi-flower-alt",
    submenu: [{
        title: "BS Glyphicon",
        url: "#/?url=app%2Fmodules%2Ficons3&title=Glyphicon"
    },
    {
        title: "Google Material Design",
        url: "#/?url=app%2Fmodules%2Ficons&title=Google Material Design"
    },
    {
        title: "Material Design Iconic",
        url: "#/?url=app%2Fmodules%2Ficons2&title=Material Design Iconic"
    }]
},
{
    title: "Typography",
    divider: !0
},
{
    title: "Theme",
    icon: "zmdi zmdi-eye",
    url: "#/?url=app/modules/themes&theme=yellow&title=themes"
},
{
    title: "Helper classes",
    icon: "zmdi zmdi-star-outline",
    url: "#/?url=app%2Fmodules%2Fclass&theme=orange&title=helper classes"
},
{
    title: "Material Colors",
    icon: "zmdi zmdi-invert-colors",
    url: "#/?url=app/modules/colors&theme=purple&title=colors"
},
{
    title: "Typography",
    icon: "zmdi zmdi-brush",
    url: "#/?url=app/modules/typography&theme=teal&title=typography"
},
{
    title: "Extras",
    divider: !0
},
{
    title: "Extras",
    icon: "zmdi zmdi-apps",
    submenu: [{
        title: "Inbox",
        url: "#/?url=app/modules/inbox&theme=green&title=inbox"
    },
    {
        title: "Gallery",
        url: "#/?url=app/modules/gallery&theme=pink&title=gallery"
    },
    {
        title: "Profile",
        url: "#/?url=app/modules/profile&theme=red&title=profile"
    },
    {
        title: "Blank Template",
        url: "#/?url=app/modules/blank&theme=bluegrey&title=blank template"
    }]
},
{
    title: "Pages",
    icon: "zmdi zmdi-collection-item",
    submenu: [{
        title: "Login",
        url: "login.html"
    },
    {
        title: "Err 404",
        url: "404.html"
    },
    {
        title: "Err 500",
        url: "500.html"
    },
    {
        title: "Lockscreen",
        url: "lockscreen.html"
    }]
},
{
    title: "Menu Level",
    icon: "zmdi zmdi-menu",
    submenu: [{
        title: "Level  A....",
        icon: "",
        submenu: [{
            title: "Level A1 ....",
            url: "/#"
        },
        {
            title: "Level A2 ....",
            url: "/#"
        },
        {
            title: "Level A3 ....",
            url: "/#"
        }]
    },
    {
        icon: "",
        title: "Level B...."
    },
    {
        title: "Level C....",
        icon: "",
        submenu: [{
            title: "Level C1 ....",
            url: "/#"
        },
        {
            title: "Level C2 ....",
            url: "/#"
        },
        {
            title: "Level C3 ....",
            url: "/#"
        }]
    }]
},
{
    title: "About ＆ Buy",
    icon: "zmdi zmdi-info-outline",
    url: "#/?url=app/modules/about&title=about"
}],
TabManager = {
    SELECTEDINDEX: 0,
    MAXTABSIZE: 20,
    TABS: [],
    addTab: function(e, t, l, i, o) {
        if (t && e) {
            var r = md5(e + t),
            u = this.hasTab(r);
            if (u == -1) {
                var a = this.TABS.length;
                if (a > this.MAXTABSIZE) return - 9;
                this.TABS.push({
                    key: r,
                    title: t,
                    path: e,
                    hash: i,
                    icon: l,
                    theme: o
                })
            } else if (u != -1 && u != this.SELECTEDINDEX) return this.SELECTEDINDEX = u,
            u
        }
    },
    hasTab: function(e) {
        for (var t = -1,
        l = 0; l < this.TABS.length; l++) if (this.TABS[l].key == e) {
            t = l;
            break
        }
        return t
    },
    removeTab: function(e) {
        var t = this.TABS.indexOf(e);
        this.TABS.splice(t, 1),
        window.location.href = "#"
    },
    removeOtherTab: function(e) {
        this.TABS = [e],
        window.location.href = "#"
    },
    removeAllTab: function() {
        this.TABS = [],
        window.location.href = "#"
    }
};
var AdmUI = angular.module("admUI", ["ngAnimate", "ngMaterial", "ngRoute", "ngMessages", "ngAria", "ngMaterial", "oc.lazyLoad", "ui.bootstrap", "chieffancypants.loadingBar"]);
AdmUI.config(function($routeProvider, $mdThemingProvider, cfpLoadingBarProvider) {
    cfpLoadingBarProvider.includeSpinner = !0,
    $mdThemingProvider.theme("yellow").primaryPalette("yellow"),
    $mdThemingProvider.theme("bluegrey").primaryPalette("blue-grey"),
    $mdThemingProvider.theme("teal").primaryPalette("teal"),
    $mdThemingProvider.theme("grey").primaryPalette("grey"),
    $mdThemingProvider.theme("green").primaryPalette("green"),
    $mdThemingProvider.theme("orange").primaryPalette("orange"),
    $mdThemingProvider.theme("blue").primaryPalette("blue"),
    $mdThemingProvider.theme("purple").primaryPalette("purple"),
    $mdThemingProvider.theme("red").primaryPalette("red"),
    $mdThemingProvider.theme("pink").primaryPalette("pink"),
    $mdThemingProvider.theme("indigo").primaryPalette("indigo"),
    $mdThemingProvider.alwaysWatchTheme(!0),
    $mdThemingProvider.setDefaultTheme("blue")
}),
AdmUI.controller("AdmUICtrl",
function($scope, $mdToast, $route, $routeParams, $location, $timeout, cfpLoadingBar) {
    var me = this;
    cfpLoadingBar.start(),
    /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && angular.element("html").addClass("ismobile"),
    $scope.appCfg = {
        title: "AdmUI",
        loading: !1,
        specialTheme: "",
        currentTheme: localStorage.getItem("app_current_theme") || "blue",
        isFullScreen: localStorage.getItem("app_full_screen") || "0",
        currentLayout: localStorage.getItem("app_current_layout") || "1",
        footerEnabled: localStorage.getItem("app_footer_enabled") || "1",
        openInsetTab: localStorage.getItem("app_open_inset_tab") || "1",
        sidebarToggle: !1,
        themeList: ["yellow", "bluegrey", "teal", "grey", "green", "orange", "blue", "purple", "red", "pink", "indigo"],
        fullScreen: function() {
            "1" == $scope.appCfg.isFullScreen ? ($scope.appCfg.isFullScreen = "0", $scope.appCfg.currentLayout = "1", $scope.appCfg.sidebarToggle = !0, $scope.appCfg.footerEnabled = "1") : ($scope.appCfg.isFullScreen = "1", $scope.appCfg.currentLayout = "0", $scope.appCfg.sidebarToggle = !1, $scope.appCfg.footerEnabled = "0", $scope.appCfg.openInsetTab = "1")
        },
        closeSidebar: function(e) {
            $scope.appCfg.sidebarToggle = !1
        },
        switchTheme: function(color) {
            $scope.appCfg.currentTheme = color,
            localStorage.setItem("app_current_theme", color)
        },
        mainMenu: MainMenuConfig
    },
    $scope.gotoUrl = function(url) {
        window.location.href = url
    },
    $scope.$watchGroup(["appCfg.currentLayout", "appCfg.footerEnabled", "appCfg.isFullScreen", "appCfg.openInsetTab"],
    function(newValues, oldValues, scope) {
        localStorage.setItem("app_current_layout", newValues[0]),
        localStorage.setItem("app_footer_enabled", newValues[1]),
        localStorage.setItem("app_full_screen", newValues[2]),
        localStorage.setItem("app_open_inset_tab", newValues[3]),
        newValues[3] != oldValues[3] && (window.location.href = "#")
    }),
    me.tabManager = TabManager,
    $scope.PAGEURL = "",
    $scope.$watch(function() {
        return $location.$$url
    },
    function(path) {
        if ("#" != path.base) {
            var search = $location.search(),
            _path = search.url,
            title = search.title,
            theme = search.theme || "",
            icon = search.icon,
            hash = "#/?url=" + _path + "&title=" + title;
            icon || (icon = "bookmark-outline"),
            _path && title && 1 == $scope.appCfg.openInsetTab ? me.tabManager.addTab(_path, title, icon, hash, theme) : 1 != $scope.appCfg.openInsetTab && _path && ($scope.PAGEURL = _path, theme ? $scope.appCfg.specialTheme = theme: $scope.appCfg.specialTheme = "")
        }
    }),
    $scope.$watch(function() {
        return me.tabManager.TABS.length + me.tabManager.SELECTEDINDEX
    },
    function(current, old) {
        if (!$scope.PAGEURL) {
            var tab = me.tabManager.TABS[me.tabManager.SELECTEDINDEX];
            $timeout(function() {
                tab && tab.theme ? $scope.appCfg.specialTheme = tab.theme: $scope.appCfg.specialTheme = ""
            },
            350)
        }
    })
}).controller("HeaderCtrl",
function($scope, $mdToast, $mdSidenav, $routeParams, $location, $timeout) {
    $scope.header_search_open = !1,
    $scope.closeHeaderSearch = function() {
        $(".search-widget input").val(""),
        $scope.header_search_open = !1
    },
    $scope.openHeaderSearch = function(ev) {
        $scope.header_search_open = !0,
        $timeout(function() {
            $(".search-widget input").focus()
        },
        300)
    },
    $scope.toggleRight = function() {
        $mdSidenav("right").toggle()
    }
}).controller("SidebarRCtrl",
function($scope, $mdToast, $mdSidenav, $routeParams, $location, $mdDialog) {
    $scope.toppings = [{
        name: "Pepperoni",
        wanted: !0
    },
    {
        name: "Sausage",
        wanted: !1
    },
    {
        name: "Black Olives",
        wanted: !0
    },
    {
        name: "Green Peppers",
        wanted: !1
    }],
    $scope.settings = [{
        name: "Wi-Fi",
        extraScreen: "Wi-fi menu",
        icon: "device:network-wifi",
        enabled: !0
    },
    {
        name: "Bluetooth",
        extraScreen: "Bluetooth menu",
        icon: "device:bluetooth",
        enabled: !1
    }],
    $scope.people = [{
        name: "Janet Perkins",
        img: "img/100-0.jpeg",
        newMessage: !0
    },
    {
        name: "Mary Johnson",
        img: "img/100-1.jpeg",
        newMessage: !1
    },
    {
        name: "Peter Carlsson",
        img: "img/100-2.jpeg",
        newMessage: !1
    }],
    $scope.navigateTo = function(action, event) {}
}),
angular.element(document).ready(function() {
    angular.bootstrap(document, ["admUI"])
}),
AdmUI.directive("changeLayout",
function() {
    return {
        restrict: "A",
        scope: {
            changeLayout: "="
        },
        link: function(scope, element, attr) {
            "1" === scope.changeLayout && element.prop("checked", !0),
            element.on("change",
            function() {
                element.is(":checked") ? (localStorage.setItem("app_current_layout", 1), scope.$apply(function() {
                    scope.changeLayout = "1"
                })) : (localStorage.setItem("app_current_layout", 0), scope.$apply(function() {
                    scope.changeLayout = "0"
                }))
            })
        }
    }
}).directive("toggleSidebar",
function() {
    return {
        restrict: "A",
        scope: {
            modelLeft: "="
        },
        link: function(scope, element, attr) {
            element.on("click",
            function() {
                "mainmenu" === element.data("target") && (scope.modelLeft === !1 ? scope.$apply(function() {
                    scope.modelLeft = !0
                }) : scope.$apply(function() {
                    scope.modelLeft = !1
                }))
            })
        }
    }
}).directive("toggleSubmenu",
function() {
    return {
        restrict: "A",
        link: function(scope, element, attrs) {
            element.click(function() {
                element.next().slideToggle(200),
                element.parent().toggleClass("toggled")
            })
        }
    }
}).directive("miniScroll",
function() {
    return {
        restrict: "C",
        link: function(scope, element) { (element.hasClass("only-mobile") && $("html").hasClass("ismobile") || !element.hasClass("only-mobile")) && $(element).mCustomScrollbar({
                theme: "minimal-dark",
                scrollInertia: 0,
                axis: "y",
                mouseWheel: {
                    enable: !0,
                    axis: "y",
                    preventDefault: !0
                }
            })
        }
    }
}).directive("bsPopover",
function() {
    return {
        restrict: "A",
        link: function(scope, element, attrs) {
            $(element).popover()
        }
    }
}).directive("viewCode", ["$mdDialog",
function($mdDialog) {
    return {
        restrict: "A",
        link: function(scope, element, attrs) {
            element.click(function() {
                var e = $(element).parent().find("+ md-card-content"),
                html = e.html();
                alertcode = $mdDialog.alert().title("Souce Code").content(html).ok("Close"),
                $mdDialog.show(alertcode)["finally"](function() {
                    alertcode = void 0
                })
            })
        }
    }
}]),
AdmUI.factory("RestService", ["$http",
function($http) {
    var RestService = function(url) {
        this.setURL(url),
        this.get = function(conf, callback) {
            this.http("GET", conf, callback)
        },
        this.create = function(conf, callback) {
            this.http("POST", conf, callback)
        },
        this.update = function(conf, callback) {
            this.http("PUT", conf, callback)
        },
        this["delete"] = function(conf, callback) {
            this.http("DELETE", conf, callback)
        }
    };
    return RestService.prototype = {
        constructor: RestService,
        setURL: function(url) {
            this.url = url
        },
        getURL: function() {
            return this.url
        },
        http: function(method, conf, callback) {
            var url = this.url;
            conf.urlData && (url += conf.urlData),
            conf.headers = conf.headers || {
                "Content-Type": "application/text"
            },
            $http({
                method: method,
                url: url,
                params: conf.params,
                data: conf.data,
                headers: conf.headers
            }).success(function(data, status) {
                callback(data, status)
            })
        }
    },
    RestService
}]);